{include file="public/header" /}
<style type="text/css">
    #des, #des input {
        width: 40px;
        text-align: center;
    }

    #id {
        width: 78px;
    }

    .bs-checkbox {
        width: 36px;
        height: 40px
    }

    .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
        margin-left: 0px;
        margin-top: 0px
    }

    #title span {
        float: right;
    }

    .btn-active {
        background: #1ab394;
        color: #fff
    }

    /*#nav a{*/
        /*border:2px #bbb solid!important;color:#101010!important;*/
        /*backgroud:#fff;*/
    /*}*/

</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        {include file="public/tophead"}
        {include file="public/top" /}
        <div class="ibox-content">
            <div class="row row-lg">

                <div style="display:block;clear: both;"></div>
                <div class="fixed-table-toolbar" id="nav">
                    <a class="btn btn-default btn-outline{if input('get.type/d') eq ''} btn-active{/if}"
                       href="{:url('Member/applyList')}">所有申请</a>
                    <a class="btn btn-default btn-outline{if input('get.type/d') eq 1} btn-active{/if}"
                       href="{:url('Member/applyList',['type'=>1])}">今日申请</a>
                    <a class="btn btn-default btn-outline{if input('get.type/d') eq 2} btn-active{/if}"
                       href="{:url('Member/applyList',['type'=>2])}">初审申请</a>
                    <a class="btn btn-default btn-outline{if input('get.type/d') eq 3} btn-active{/if}"
                       href="{:url('Member/applyList',['type'=>3])}">复审申请</a>
                    {if $handle_count>0}<a style="float: right;" class="btn btn-default" onClick="delAll(-1)">清除已处理{$handle_count}</a>{/if}
                </div>

                <div class="example">
                    <form class="form-horizontal" method="post">
                        <table data-toggle="table">
                            <thead>
                            <tr>
                                <th data-align="center">ID</th>
                                <th data-align="center">用户ID</th>
                                <th data-align="center">头像</th>
                                <th data-align="center">昵称</th>
                                <th data-align="center">出生日期</th>
                                <th data-align="center">性别</th>
                                <th data-align="center">城市</th>
                                <th data-align="center">手机</th>
                                <th data-align="center">微信</th>
                                <th data-align="center">职业</th>
                                <th data-align="center">其他</th>
                                <th data-align="center">拒绝理由</th>
                                <th data-align="center">提交时间</th>
                                <th data-align="center">申请类型</th>
                                <th data-align="center">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr id="id{$vo.id}">
                                <td>{$vo.id}</td>
                                <td>{$vo.member_id}</td>
                                <td><img src="{if empty($vo.avatar)}__PUBLIC__/disk/avatar/user-default.jpg{else}{$vo.avatar}{/if}" width="40" height="40"/></td>
                                <td>{$vo.nickname}</td>
                                <td>{$vo.birthday}</td>
                                <td>{$sexs[$vo['sex']]}</td>
                                <td>{$vo.city_name}</td>
                                <td>{$vo.username}</td>
                                <td>{$vo.wechat}</td>
                                <td>{$vo.profession}</td>
                                <td><span class="btn btn-xs btn-primary" onClick="showOther(this)"
                                          data-content_types="{$vo.content_types}"
                                          data-expect_object="{$vo.expect_object}"
                                          data-height="{$vo.height}"
                                          data-weight="{$vo.weight}"
                                >查看</span></td>
                                <td>{$vo.reason}</td>
                                <td>{$vo.apply_time|date='Y-m-d H:i:s'}</td>
                                <td>{if $vo.first_trial}初审{else}复审{/if}</td>
                                <td>
                                    <span class="btn btn-xs btn-primary" {if $vo['state']<>3}onClick="add('{:url('Member/applyAdd',['id'=>$vo['id'],'url'=>-1])}')"
                                    {/if}>{$states[$vo['state']]}</span> </td>
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </form>
                </div>
            </div>

            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$page|raw}</div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.css"}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.js"}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table-zh-CN.min.js"}
<script type="text/javascript">
    function showOther(object) {
        var content_types = object.dataset.content_types;
        var expect_object = object.dataset.expect_object;
        var weight = object.dataset.weight;
        var height = object.dataset.height;
        var content_types_arr = content_types.split('/');
        var expect_object_arr = expect_object.split('/');

        var content = '<div style="padding:20px 50px 20px; line-height: 22px;"> 交友节目：&nbsp;&nbsp;&nbsp;&nbsp;';
        for (var i = 0; i < content_types_arr.length; i++) {
            content = content + content_types_arr[i] + "&nbsp;&nbsp;"
        }
        content = content + '<br> 期望对象：&nbsp;&nbsp;&nbsp;&nbsp;';
        for (var i = 0; i < expect_object_arr.length; i++) {
            content = content + expect_object_arr[i] + "&nbsp;&nbsp;"
        }
        content = content + '<br>身高：&nbsp;&nbsp;&nbsp;&nbsp;';
        content = content + height;
        content = content + '<br>体重：&nbsp;&nbsp;&nbsp;&nbsp;';
        content = content + weight;
        layer.open({
            type: 1,
            title: '其他',
            shadeClose: false,
            shade: 0.2,
            area: ['80%', '30%'],
            // skin: 'shangchuantup',
            content: content
        });
    }

    //id  -1删除所有
    function delAll() {

        swal_delAll({'state': '1,2,3'}, "{:url('Member/delAllApply')}", "1")
    }

</script>
